// 时间格式化
// yyyy年mm月dd日-hh:mm:ss
// yyyy  mm dd  -hh:mm:ss
// yyyy yyyy yyyy
let time = 1654444545111
let nowTime = new Date()
let year = nowTime.getFullYear()
let month = nowTime.getMonth()
let day = nowTime.getDate()
let hour = nowTime.getHours()
let minute = nowTime.getMinutes()
let seconds = nowTime.getSeconds()
console.log(hour,minute,seconds);
function timeFormat(time) {
    switch(time) {
        case 'yyyy年mm月dd日-hh:mm:ss':
            return `${year}年${month}月${day}日-${hour}:${minute}:${seconds}`;
            break;
        case 'yyyy yyyy yyyy':
            return `${year} ${year} ${year}`;
            break;
        case 'yyyy  mm dd  -hh:mm:ss':
            return `${year}    ${month}    ${day} -${hour}:${minute}:${seconds}`
    }
}
let res = timeFormat('yyyy yyyy yyyy')
console.log(res);